package com.github.jspxnet.worktask.core.node;

import com.github.jspxnet.enums.RecycleEnumType;
import com.github.jspxnet.worktask.model.dto.ProcessResponse;
import java.util.Date;

public class SingleResultNodeAction extends BaseNodeAction {
    @Override
    public ProcessResponse<?> execute()
    {
        currentWorkTask.setRecycleType(RecycleEnumType.YES_RECYCLE.getValue());
        currentWorkTask.setRecycleDate(new Date());
        try {
            runtimeServiceDAO.update(currentWorkTask,new String[]{"recycleType","recycleDate"});
            return ProcessResponse.success(currentWorkTask);
        } catch (Exception e) {
            e.printStackTrace();
            return ProcessResponse.error(e.getMessage());
        }
    }
}